<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{$theme['title']}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="{$_G['URL']['EDUCATION_STATIC_PATH']}/css/reset.css">
    <link rel="stylesheet" type="text/css" href="{$_G['URL']['EDUCATION_STATIC_PATH']}/css/style.css">
    <script src="{$_G['URL']['EDUCATION_STATIC_PATH']}/js/screen.js"></script>
    <script src="{$_G['URL']['EDUCATION_STATIC_PATH']}/js/jquery.js"></script>
    <script src="{$_G['URL']['LOTTERY_CSS']}lottery/js/layer/layer.js"></script>
</head>
<body>
<div class="contactBanner">
    <img src="{$_G['URL']['EDUCATION_STATIC_PATH']}/images/contactBanner.png" >
    <img src="{$_G['URL']['EDUCATION_STATIC_PATH']}/images/contactTit1.png" class="bannerTxt" >
    <img src="{$_G['URL']['EDUCATION_STATIC_PATH']}/images/contactTit2.png" class="bannerInfor" >
</div>
<div class="contactPage">
    <h2>我是机构</h2>
    <div class="schoolInfor">
        <h3>我们的校区也要参加活动</h3>
        <p>·我是一家培训机构，我要参加这样的活动</p>
        <p>·我们校区要组织这样的活动（平台派人驻店全程指导），提供软件技术支持</p>
        <p>·我有团队，我要申请城市服务商</p>
        <a href="javascript:void(0)" onclick="joinIt()">立即加入</a>
    </div>
    <h2>我有团队</h2>
    <div class="teamInfor">
        <h3>我们的校区也要参加活动</h3>
        <p>·我是一家培训机构，我要参加这样的活动</p>
        <p>·我们校区要组织这样的活动（平台派人驻店全程指导），提供软件技术支持</p>
        <p>·我有团队，我要申请城市服务商</p>
        <a href="">立即加入</a>
    </div>
    <div class="form" style="border: 1px solid darkgray;border-radius: 5%;">
        <div class="payForm" id="o_form">
            <h3>请填写你的信息</h3>
            <ul>
                <li>
                    <p>机构名称</p>
                    <input type="text" class="company_name" name="company_name" placeholder="请填写机构名称" value="" />
                </li>
                <li>
                    <p>负责人姓名</p>
                    <input type="text" class="username" name="username" placeholder="请填写负责人姓名" value="" />
                </li>
                <li>
                    <p>所在城市</p>
                    <input type="text" class="address" name="address" placeholder="请输入所在城市" value="" />
                </li>
                <li>
                    <p>手机号</p>
                    <input type="text"  class="mobile" name="mobile" placeholder="请填写手机号" value="" />
                </li>
            </ul>
            <div class="button" onclick="confirm()">
                <span>立即报名</span>
            </div>
            <div class="button confirm_cancel over">
                <span>取消</span>
            </div>
        </div>
    </div>

</div>
</body>
<style>
    .form{
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        min-height: 100vh;
        background-color: #f7f7f7;
        padding: 0.16rem;
        top: 100vh;
        transition: top 1s;
    }
    .form.show{
        top: 0;
    }
     .button{
         height: 0.86rem;
         background:linear-gradient(90deg, #FF8E0D -4.33%, #FF5005 96.22%);
         color: #ffffff;
         font-size: 0.28rem;
         display: flex;
         justify-content: center;
         align-items: center;
         border-radius: 0.2rem;
         margin: 0 auto;
    }
     .button.over{
         background: #999999;
         color: #eee;
         margin-top: 0.2rem;
     }
</style>
<script>
    function joinIt() {
        $(".form").addClass("show");
    }
    $(".confirm_cancel").click(()=>{
        $(".form").removeClass("show");
    })
    function confirm() {
        let company_name=$(".company_name").val();
        if(!company_name){
            layer.msg('请输入机构名称');
            return;
        }
        let username=$(".username").val();
        if(!username){
            layer.msg('请输入负责人');
            return;
        }
        let address=$(".address").val();
        if(!address){
            layer.msg('请输入城市');
            return;
        }
        let mobile=$(".mobile").val();
        if(!isMobile(mobile))return;
        $.ajax({
            method:"POST",
            url:"/{php echo createMobileUrl('wx', array('themeid'=>$themeid,'r'=>'education.index.about','from'=>'mobile','type'=>$type,'op'=>'confirm'));}",
            data:{
                mobile:mobile,
                username:username,
                address:address,
                company_name:company_name
            },
            success:function(res){
                res=JSON.parse(res);
                if(res.error=="0"){
                    layer.msg('提交成功');
                    window.history.go(-1);
                }
            }
        })
    }
    function isMobile(mobile){
        if(mobile.length!=11){
            layer.msg('请正确输入手机号');
            return false;
        }else{
            var myreg = /^(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(17[0-9]{1})|(18[0-9]{1})|(19[0-9]{1}))+\d{8})$/;
            if (!myreg.test(mobile)) {
                layer.msg('手机号有误');
                return false;
            }else{
                return true;
            }
        }
    }
</script>
{include file='base/addlog'}
</html>
